import BaseFlowNode from '../BaseFlowNode'
import {assignInWith} from 'lodash'
import {FlowNodeType} from "../../types/index";
import type{FlowNodeFormConfigType, FlowNodePropsType} from "../../types/index";
import {FlowRouteNodeType} from "../../types/index";

export default class RouteNode<T> extends BaseFlowNode{
  
  private RouteType:FlowRouteNodeType=FlowRouteNodeType.EXCLUSIVE;
  //路由网关节点分支节点
   private branchs:Array<Array<T>>=[]; 
    constructor(
      RouteType:FlowRouteNodeType,
        branchs:Array<Array<T>>,
        props:Partial<FlowNodePropsType>={},
    ) {
      
      let basePops:FlowNodePropsType={
        header: { icon: '', title: '', bgColor: '',color:'black' },
        description: ''
      }
      super(
        '路由网关节点',
        FlowNodeType.ROUTE,
        assignInWith(basePops,props),
        {}
    )
      this.RouteType=RouteType;
        this.branchs=branchs;
    }

    getBranchs():Array<Array<T>>{
      return this.branchs; 
    }

    setBranchs(branchs:Array<Array<T>>){
      this.branchs=branchs; 
    }
    getRouteType():FlowRouteNodeType{
      return this.RouteType;
    }
}
